import { randomReg, randomDateString, randomIntId } from "../utils/index";

export const getRandomCard = () => ({
    cardBtList: [
        {
            cardBtId: randomIntId(),
            cardBtName: randomReg(/\w{5,10}/),
            cardBtMold: 2,
            cardBtLink: "xxx",
            cardBtSort: 1,
            cardId: 55,
            reCardLibList: [],
        },
    ],
    cardId: randomIntId(),
    fileId: 1,
    cardTitle: randomReg(/\w{5,10}/),
    cardNotes: randomReg(/\w{5,10}/),
    cardLibId: randomIntId(),
    fileClass: "1",
    tenantId: "test",
});

export const getRandomCardLib = () => {
    return {
        cardLibId: randomIntId(),
        cardLibName: randomReg(/\w{5,10}/),
        cardLibState: 1,
        logicDelete: 1,
        modifyTime: randomDateString(),
        modifyId: "1",
        createTime: randomDateString(),
        createId: "1",
        tenantId: "1",
        copyId: null,
        cardList: new Array(Math.ceil(Math.random() * 5))
            .fill()
            .map(getRandomCard),
        cardLibBtList: [
            {
                cardLibBtId: randomIntId(),
                cardLibBtName: randomReg(/\w{5,10}/),
                cardLibBtMold: 2,
                cardLibBtLink: "xxx1",
                cardLibBtSort: 1,
                cardLibId: 47,
                reCardLibList: [],
            },
            {
                cardLibBtId: randomIntId(),
                cardLibBtName: randomReg(/\w{5,10}/),
                cardLibBtMold: 2,
                cardLibBtLink: "xxx2",
                cardLibBtSort: 1,
                cardLibId: 47,
                reCardLibList: [],
            },
        ],
    };
};
